import request from '@/config/axios'

// 年级 VO
export interface GradeVO {
  gradeName: string // 年级名称
  seq: number // 排序号
}

// 年级 API
export const GradeApi = {
  // 查询年级分页
  getGradePage: async (params: any) => {
    return await request.get({ url: `/system/grade/page`, params })
  },
  // 查询年级分页
  getGradelist: async (params: any) => {
    return await request.get({ url: `/system/grade/list`, params })
  },

  // 查询年级详情
  getGrade: async (id: number) => {
    return await request.get({ url: `/system/grade/get?id=` + id })
  },

  // 新增年级
  createGrade: async (data: GradeVO) => {
    return await request.post({ url: `/system/grade/create`, data })
  },

  // 修改年级
  updateGrade: async (data: GradeVO) => {
    return await request.put({ url: `/system/grade/update`, data })
  },

  // 删除年级
  deleteGrade: async (id: number) => {
    return await request.delete({ url: `/system/grade/delete?id=` + id })
  },

  // 导出年级 Excel
  exportGrade: async (params) => {
    return await request.download({ url: `/system/grade/export-excel`, params })
  }
}